1. Field of the Invention
The present invention relates to an image processing method, an image processing apparatus and an image processing program.
2. Related Background Art
In recent years, information has been increasingly electronified, and thus demand for converting a paper document and an electronified document into each other has been growing. For electronifying a paper document, it is desirable that the printed side of a paper is not just photoelectric-converted into image data using a scanner or the like, but a document image is divided into areas of different natures such as texts, symbols, graphics, photographs and tables, and an optimum format of data is applied for each area such as character code information for character portions, vector data for graphics, lines and table frames, image data for photographs and structural data for contents of tables.
In this way, in processing for electronifying a paper document, processing for analyzing the contents written in a document image to divide the contents into sectional areas of different natures such as characters, graphics, photographs and tables, namely area division processing is of great importance.
For the methodology of this area division processing, it has been proposed, for example, that a document image read with multi-values (grayscale or color) as shown in FIG. 21 is converted into a binary image with a difference in luminance, pixel blocks having black pixels in outlines, existing in the image, are all extracted and classified into characters and non-characters according to their sizes, and pixels are searched recursively from the insides of white pixel areas existing in non-character large black pixel blocks, whereby a situation of pixel blocks is expressed with a hierarchical tree structure shown in FIG. 16. The image is divided into areas having a variety of attributes by processing of grouping character pixel blocks present in the same level of hierarchy to obtain a character area, obtaining graphics and photograph areas from the shapes of non-character pixel blocks and peripheral conditions, obtaining a front area as a set of pixels constituting a hierarchy, and so on, for the tree structure of pixel blocks, whereby an area division result shown in FIG. 22 can be obtained. Furthermore, at this time, information suitable for determination of logical structure of a document is provided by making each area having a tree structure shown in FIG. 23.
In this area division processing, however, it is not easy to sample an area of luminance inverted characters included in FIG. 21, namely an area of characters constituted not by black-on-white pixels but by white-on-black pixels (inverted character, outlined character) on a binary image, in terms of configuration of processing. In addition, it has been proposed that the numbers of black and white pixels are compared to each other, and the pixels are inverted if it is determined that the number of black pixels is larger, whereby inverted characters can be recognized, but it is difficult to obtain a correlation between normal characters and inverted characters, and it is thus impossible to obtain from a document including both normal characters and inverted characters a tree structure dealing with collectively normal characters and inverted characters of the document.